import request from '@/config/axios'

// 机供品餐具清洗计划 VO
export interface CleaningPlanVO {
  id: number // 唯一标识符
  cplanName: string // 餐具清洗计划名称
  cplanCode: string // 餐具清洗计划编号(MEAL-YYYY-XXX)
  flightNo: string // 关联航班号
  tablewareType: string // 餐具类型
  tablewareQty: number // 餐具数量(个)
  cleaningStatus: string // 清洗状态
  specialRemarks: string // 特别说明
  startDate: Date // 计划有效期开始
  endDate: Date // 计划有效期结束
  remarks: string // 备注
}

// 机供品餐具清洗计划 API
export const CleaningPlanApi = {
  // 查询机供品餐具清洗计划分页
  getCleaningPlanPage: async (params: any) => {
    return await request.get({ url: `/acm/cleaning-plan/page`, params })
  },

  // 查询机供品餐具清洗计划详情
  getCleaningPlan: async (id: number) => {
    return await request.get({ url: `/acm/cleaning-plan/get?id=` + id })
  },

  // 新增机供品餐具清洗计划
  createCleaningPlan: async (data: CleaningPlanVO) => {
    return await request.post({ url: `/acm/cleaning-plan/create`, data })
  },

  // 修改机供品餐具清洗计划
  updateCleaningPlan: async (data: CleaningPlanVO) => {
    return await request.put({ url: `/acm/cleaning-plan/update`, data })
  },

  // 修改机供品餐具清洗计划-清洗状态
  updateCleaningPlanStatus: async (data: CleaningPlanVO) => {
    return await request.put({ url: `/acm/cleaning-plan/update-status`, data })
  },

  // 删除机供品餐具清洗计划
  deleteCleaningPlan: async (id: number) => {
    return await request.delete({ url: `/acm/cleaning-plan/delete?id=` + id })
  },

  // 导出机供品餐具清洗计划 Excel
  exportCleaningPlan: async (params) => {
    return await request.download({ url: `/acm/cleaning-plan/export-excel`, params })
  }
}
